import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * 
 */
public class 数字序列比大小 {
    
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        Integer[] aArr = new Integer[n];
        for(int i=0; i<n; i++){
            aArr[i] = in.nextInt();
        }
        Integer[] bArr = new Integer[n];
        for(int i=0; i<n; i++){
            bArr[i] = in.nextInt();
        }

        //A每次都取出最小的数 和 B每次都取出最小的数做比较
        //A 赢了 +1 相等 不加分  输了 -1

        //排序 升序
        List<Integer> aList = Arrays.stream(aArr).sorted((a, b) -> a - b).collect(Collectors.toList());
        //降序
        List<Integer> bList = Arrays.stream(bArr).sorted((a, b) -> a - b).collect(Collectors.toList());

        //转换成 LinkedList 便于移出比较过的值
        LinkedList<Integer> aLinkList = new LinkedList<>(aList);
        LinkedList<Integer> bLinkList = new LinkedList<>(bList);

        //赢的次数
        int winnerCount = 0;

        while (!aLinkList.isEmpty()) {
            //取出值进行比较
            int aValue = aLinkList.removeFirst();
            boolean hasMore = false;
            Integer bValue = -1;

            while (!bLinkList.isEmpty()) {

                bValue = bLinkList.peek();

                if(aValue > bValue){
                    hasMore = true;
                    break;
                } else if(aValue < bValue){
                    //winnerCount -= 1;
                    hasMore = false;
                    continue;
                }
            }

            if(hasMore){
                winnerCount += 1;
                bLinkList.remove(bValue);
            } else {

                winnerCount -= 1;
                bLinkList.remove(bValue);
            }

        }
        

        System.out.println(winnerCount);


    }
}
